package leetcode;

/**
 * Created with IntelliJ IDEA.
 * User: Ghost
 * Date: 14-6-10
 * Time: 下午7:11
 * To change this template use File | Settings | File Templates.
 */
public class Search_Insert_Position {
    public static int searchInsert(int[] A, int target) {
        for(int i=0;i<A.length;i++){
           if(A[i]>=target){
               return i;
           }
        }
        return A.length;
    }
    public static void main(String[] args){
        int[] A = {1,2,3,5,6,7};
        System.out.println(searchInsert(A,4));
    }
}
